package com.kefu.sys.service;

import com.baomidou.mybatisplus.core.incrementer.DefaultIdentifierGenerator;
import com.kefu.common.service.AbstractKefuService;
import com.kefu.common.service.KefuService;
import com.kefu.sys.mapper.SysRoleMenuMapper;
import com.kefu.sys.model.SysRoleMenu;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class SysRoleMenuService extends AbstractKefuService<SysRoleMenu>  {
    @Autowired
    protected SysRoleMenuMapper sysRoleMenuMapper;
    DefaultIdentifierGenerator generator = new DefaultIdentifierGenerator();

    public void batchAdd(List<SysRoleMenu> roleMenus) {
        roleMenus.stream().forEach(menu-> menu.setId(generator.nextId(menu)));
        sysRoleMenuMapper.batchAdd(roleMenus);
    }
}